home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / vwfd.zip / TSTWF.ASM < prev    next >
Assembly Source File  |  1992-03-17  |  4KB  |  135 lines

  1.         name    tstwf
  2. ;****************************************************************************
  3. ;
  4. ;   (C) Copyright MICROSOFT Corp., 1990
  5. ;
  6. ;   Title:      TSTWF.ASM
  7. ;
  8. ;   Version:    3.00
  9. ;
  10. ;   Date:       15-Nov-1990 
  11. ;
  12. ;   Author:     Neil Sandlin
  13. ;
  14. ;       
  15. ;       This small DOS application will call the VWFD API which
  16. ;       returns the state of a VM: Windowed or Full screen.
  17. ;       The API's used by this application are:
  18. ;
  19. ;       INT 2Fh, AX=1600h - determine if enhanced mode Windows is running
  20. ;       INT 2Fh, AX=1684h - get VxD API callback address
  21. ;
  22. ;       The VWFD API is as follows:
  23. ;
  24. ;       call    VWFD_API_Callback
  25. ;
  26. ;       entry:
  27. ;           BX=VMID of the VM to test  
  28. ;
  29. ;       exit:
  30. ;           AX=0 if VM is full screen
  31. ;
  32. ;****************************************************************************
  33.  
  34.         include VWFD.INC
  35.  
  36. _DATA   segment word public 'DATA'
  37.  
  38. Apientry dd     ?
  39.  
  40. cr      equ     0dh
  41. lf      equ     0ah
  42.  
  43. msg1  db      cr,lf,'Full Screen.',cr,lf
  44. msg1l equ     $-msg1
  45.  
  46. msg2  db      cr,lf,'In a Window.',cr,lf
  47. msg2l equ     $-msg2
  48.  
  49. msg3  db      cr,lf,'Not running Windows enhanced mode.',cr,lf
  50. msg3l equ     $-msg3
  51.  
  52. msg4  db      cr,lf,'VWFD is not installed.',cr,lf
  53. msg4l equ     $-msg4
  54.  
  55. msg5  db      cr,lf,'Specified VM does not exist.',cr,lf
  56. msg5l equ     $-msg5
  57. _DATA   ends
  58.  
  59.  
  60.  
  61. _TEXT   segment word public 'CODE'
  62.         assume cs:_TEXT,ds:_DATA
  63.  
  64. ;*--------------------------------------------------------------------*
  65.  
  66. tstwf   proc    far
  67.         mov     ax,_DATA
  68.         mov     ds,ax
  69.  
  70.         mov     ax,1600h                ; enhanced mode?
  71.         int     2fh                     ; api call
  72.         test    al,7fh                  ; enhance mode running?
  73.         jz      not_running_enhanced    ; no
  74.  
  75.         mov     ax,1684h                ; Get Device API call
  76.         mov     bx,VWFD_Dev_ID          ; for the VWFD VxD
  77.         int     2fh                     ; do enhanced api
  78.         mov     WORD PTR Apientry,di    ; save the callback address
  79.         mov     WORD PTR Apientry+2,es
  80.  
  81.         mov     ax,es                   ; is VWFD installed?
  82.         or      ax,di
  83.         jz      vwfd_not_installed      ; if not, split
  84.  
  85.         mov     bx, 2                   ; check for this VMID
  86.         call    DWORD PTR Apientry      ; call VWFD
  87.                                         ; if AX=0, we're running 
  88.                                         ; fullscreen
  89.  
  90.         jc      api_error
  91.         or      ax,ax                   ; anything on?
  92.         jz      full_screen
  93.  
  94. ; windowed
  95.         mov     dx,offset msg2          ; 
  96.         mov     cx,msg2l
  97.         jmp     short write_msg
  98.  
  99. full_screen:        
  100.         mov     dx,offset msg1          ; load 
  101.         mov     cx,msg1l
  102.         jmp     short write_msg         ; go output
  103.  
  104. not_running_enhanced:
  105.         mov     dx,offset msg3          ; load 
  106.         mov     cx,msg3l
  107.         jmp     short write_msg         ; go output
  108.  
  109. vwfd_not_installed:
  110.         mov     dx,offset msg4          ; load 
  111.         mov     cx,msg4l
  112.         jmp     short write_msg         ; go output
  113.  
  114. api_error:
  115.         mov     dx,offset msg5          ; load 
  116.         mov     cx,msg5l
  117.  
  118. write_msg:
  119.         mov     bx,1                    ; stdout
  120.         mov     ah,40h                  ; DOS write
  121.         int     21h
  122.  
  123.         mov     ax,4c00h                ; exit to DOS
  124.         int     21h
  125. tstwf endp
  126.  
  127.  
  128. _TEXT   ends
  129.  
  130.  
  131. ;*--------------------------------------------------------------------*
  132.  
  133.         end     tstwf
  134. 
  135.